#!/usr/bin/env /usr/bin/perl

use utf8;
use Unicode::Normalize;

# U+FB01		- fi连字
# U+0065 U+0301 - 分解形式的e(然后上面有一撇)
# U+00E9		- 组合形式的上一个字符e

binmode STDOUT, ':utf8';

my $string = "Can you \x{FB01}nd my r \x{E9}sum\x{E9}?";

if($string =~ /\x{65}\x{301}/){
	print "Oops! Matched a decomposed e\n";
}
if($string =~ /\x{E9}/){
	print "Yay! Matched a composed e\n";
}

my $nfd = NFD($string);

if($nfd =~ /\x{E9}/){
	print "Oops! Matched a composed e\n";
}
if($nfd =~ /fi/){
	print "Oops! Matched a decomposed fi\n";
}

my $nfkd = NFKD($string);

if($nfkd =~ /fi/){
	print "Oops! Matched a decomposed fi\n";
}
if($nfkd =~ /fi/){
	print "Yay! Matched a decomposed fi\n";
}
if($nfkd =~ /\x{65}\x{301}/){
	print "Yay! Matched a decomposed e\n";
}
